package com.yourenbang.lingyun.transaction.web.domain.dto.pay.app;

import com.yourenbang.lingyun.constants.enums.ChannelIdEnums;
import com.yourenbang.lingyun.constants.enums.PlatNoEnums;
import com.yourenbang.lingyun.constants.enums.pay.PayFromEnum;
import com.yourenbang.lingyun.constants.enums.pay.PayTypeEnum;
import com.yourenbang.lingyun.core.base.validator.EnumValue;
import com.yourenbang.lingyun.core.util.json.ToJSON;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

@Data
public class AppPayDTO implements Serializable, ToJSON {

    @NotBlank(message = "用户id不可空")
    private String userBaseId;

    @EnumValue(enumClass = PayTypeEnum.class, message = "支付方式未通过校验")
    private String payType;

    @EnumValue(enumClass = PayFromEnum.class, message = "支付类型未通过校验")
    private String payFrom;

    @Pattern(regexp = "^(([1-9]{1}\\d*)|([0]{1}))(\\.(\\d){0,2})?$", message = "请输入合法金额")
    private String amount;

    /**
     * 采用余额支付时,对应的资金账户
     */
    private Integer accountType;

    /**
     * 余额金额,如果使用余额,需要指定资金账户类型
     */
    private String balanceAmount;

    @NotBlank(message = "订单号不可空")
    private String orderNo;

    private String msgCode; //短信验证码     积分支付上送

    @EnumValue(enumClass = PlatNoEnums.class, message = "系统类型未通过校验")
    private Short platNo;

    @EnumValue(enumClass = ChannelIdEnums.class, message = "渠道类型未通过校验")
    private Short channelId;

    private String ip;      //非必传

}
